package com.example.javademo.commons;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class BeanFactory {

    @Bean
    public OSS initOSS() {
        String ak = "LTAI5tFEgB8ur5tnVJPcfBpG";
        String sk = "LbXhTMEdz5fYYWZlw7i5fyq4QdnALt";
        String endpoint = "oss-cn-hangzhou.aliyuncs.com";
        return new OSSClientBuilder().build(endpoint, ak, sk);
    }
}
